package com.vite.file.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 文件记录表
 * </p>
 *
 * @author json
 * @since 2024-04-15
 */
@Data
@Accessors(chain = true)
@TableName("file_detail")
@Schema(description="文件记录表")
public class FileDetail{


    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "文件访问地址") 
    @TableField("url")
    private String url;

    @Schema(description = "文件大小，单位字节")
    @TableField("size")
    private Long size;

    @Schema(description = "文件名称")
    @TableField("filename")
    private String filename;

    @Schema(description = "原始文件名")
    @TableField("original_filename")
    private String originalFilename;

    @Schema(description = "基础存储路径")
    @TableField("base_path")
    private String basePath;

    @Schema(description = "存储路径")
    @TableField("path")
    private String path;

    @Schema(description = "文件扩展名")
    @TableField("ext")
    private String ext;

    @Schema(description = "MIME类型")
    @TableField("content_type")
    private String contentType;

    @Schema(description = "存储平台")
    @TableField("platform")
    private String platform;

    @Schema(description = "缩略图访问路径")
    @TableField("th_url")
    private String thUrl;

    @Schema(description = "缩略图名称")
    @TableField("th_filename")
    private String thFilename;

    @Schema(description = "缩略图大小，单位字节")
    @TableField("th_size")
    private Long thSize;

    @Schema(description = "缩略图MIME类型")
    @TableField("th_content_type")
    private String thContentType;

    @Schema(description = "文件所属对象id")
    @TableField("object_id")
    private String objectId;

    @Schema(description = "文件所属对象类型，例如用户头像，评价图片")
    @TableField("object_type")
    private String objectType;

    @Schema(description = "文件元数据")
    @TableField("metadata")
    private String metadata;

    @Schema(description = "文件用户元数据")
    @TableField("user_metadata")
    private String userMetadata;

    @Schema(description = "缩略图元数据")
    @TableField("th_metadata")
    private String thMetadata;

    @Schema(description = "缩略图用户元数据")
    @TableField("th_user_metadata")
    private String thUserMetadata;

    @Schema(description = "附加属性")
    @TableField("attr")
    private String attr;

    @Schema(description = "文件ACL")
    @TableField("file_acl")
    private String fileAcl;

    @Schema(description = "缩略图文件ACL")
    @TableField("th_file_acl")
    private String thFileAcl;

    @Schema(description = "哈希信息")
    @TableField("hash_info")
    private String hashInfo;

    @Schema(description = "上传ID，仅在手动分片上传时使用")
    @TableField("upload_id")
    private String uploadId;

    @Schema(description = "上传状态，仅在手动分片上传时使用，1：初始化完成，2：上传完成")
    @TableField("upload_status")
    private Integer uploadStatus;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;


    public static final String COL_ID = "id";

    public static final String COL_URL = "url";

    public static final String COL_SIZE = "size";

    public static final String COL_FILENAME = "filename";

    public static final String COL_ORIGINAL_FILENAME = "original_filename";

    public static final String COL_BASE_PATH = "base_path";

    public static final String COL_PATH = "path";

    public static final String COL_EXT = "ext";

    public static final String COL_CONTENT_TYPE = "content_type";

    public static final String COL_PLATFORM = "platform";

    public static final String COL_TH_URL = "th_url";

    public static final String COL_TH_FILENAME = "th_filename";

    public static final String COL_TH_SIZE = "th_size";

    public static final String COL_TH_CONTENT_TYPE = "th_content_type";

    public static final String COL_OBJECT_ID = "object_id";

    public static final String COL_OBJECT_TYPE = "object_type";

    public static final String COL_METADATA = "metadata";

    public static final String COL_USER_METADATA = "user_metadata";

    public static final String COL_TH_METADATA = "th_metadata";

    public static final String COL_TH_USER_METADATA = "th_user_metadata";

    public static final String COL_ATTR = "attr";

    public static final String COL_HASH_INFO = "hash_info";

    public static final String COL_UPLOAD_ID = "upload_id";

    public static final String COL_UPLOAD_STATUS = "upload_status";

    public static final String COL_CREATE_TIME = "create_time";


}